package com.czxy.controller;


import com.czxy.domain.User;
import com.czxy.service.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class UserController {


    @Resource
    private UserService  userService;

    @RequestMapping("/user/findAll.action")
    public  String findAll(Model model){

        //获取所有数据
        List<User> list = userService.findAll();
        //使用model转存
        model.addAttribute("list",list);
        //请求转发给list.jsp


        return "list";
















    }

}
